package com.cloud.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import com.cloud.model.File;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * Created by xinyu.qiu on 2017/2/25.
 */
@Repository
public interface FileDao extends JpaRepository<File, String> {

    File findByFileKey(String fileKey);

    List<File> findByIdIn(Collection<String> fileIds);

    List<File> findByFileKeyIn(Set<String> fileKey);

    List<File> findByIdInAndUsername(Set<Long> ids, String username);

    List<File> findByIdInOrderBySeqAsc(Collection<String> fileIds);
}
